<extend name="work/base"/>
<block name="content">
    <notempty name="user_list">
        <form class="layui-form inline-form">
            <div class="pull-left">
                <div class="layui-inline dropdown">
                    <select name="status" lay-search lay-filter="uid">
                        <option value="">选择人员</option>
                        <volist name="user_list" id="vo" key="k">
                            <option value="{$vo.uid}"> {$vo.nickname}</option>
                        </volist>
                    </select>
                </div>

            </div>
        </form>
    </notempty>
    <table class="layui-table text-center" id="list" lay-filter="list" list-url="{:url('lists')}"
           edit-url="{:url('editform')}" assigned-url="{:url('editcategory')}" del-url="{:url('delete')}"
           delinfo-url="{:url('delete')}"></table>
</block>

<block name="script">


    <script type="text/javascript">
        layui.use(['element', 'table', 'form'], function () {
            var table = layui.table
                , form = layui.form;
            table.render({
                elem: '#list'
                , url: "{:Url('lists')}"
                , page: true
                , loading: true
                , limit: 20
                , cols: [[
                     {field: 'nickname', title: '用户姓名'}
                    , {field: 'm_time', title: '月份'}
                    , {field: 'base_wage', title: '底薪+制度奖金',align:'right'}
                    , {field: 'work_time', title: '分配工时',align:'right'}
                    , {field: 'run_wage', title: '绩效',align:'right'}
                    , {field: 'login_wage', title: '出勤奖金',align:'right'}
                    , {field: 'change_wage', title: '调整金额', edit: 'text',align:'right'}
                    , {field: 'sum_wage', title: '应发',align:'right'}
                ]]
            });
            form.on('select(uid)', function (data) {
                table.reload('list', {
                    url: "{:Url('lists')}"
                    , page: {
                        curr: 1
                    }
                    , where: {
                        uid: data.value
                    }
                });
                return false;
            });
        });
    </script>
</block>
